<template>
	<view>
		<!-- 页首 -->
		<zw-header></zw-header>
		<!-- 左侧导航栏 -->
		<menu-wrapper active-index="2-1" style="background-color: #fff;padding: 0;">
			<view style="display: flex;justify-content: center;align-items: center;width: 100%;">
				<view class="card-header">
					<view class="left" style="color: #C7B480;padding-top: 100rpx;">
						<view style="color: #3D3D3D;font-size: 80rpx;font-weight: bold;">我的积分</view>
						<view
							style="color: #3D3D3D;font-size: 32rpx;border: 2rpx solid #000000;border-radius: 34rpx;padding: 12rpx 32rpx 12rpx 32rpx;">
							积分记录</view>
					</view>
					<view class="right"
						style="display: flex;justify-content: flex-start;width: 100%;margin-top: 40rpx;">
						<view
							style="background: #FFAA00;width: 100%;height: 400rpx;border-radius: 60rpx;position: relative;">
							<view
								style="padding: 100rpx;display: flex;align-items: center;justify-content: flex-start;">
								<view>
									<view class="title">账户总积分</view>
									<view class="text">1788</view>
								</view>
								<view class="s"></view>
								<view style="margin-left: 80rpx;">
									<view class="title">邀请好友奖励积分</view>
									<view class="text" style="font-size: 100rpx;">1788</view>
								</view>
								<view style="margin-left: 80rpx;">
									<view class="title">创作收益积分</view>
									<view class="text" style="font-size: 100rpx;">1788</view>
								</view>
								<view style="margin-left: 80rpx;">
									<view class="title">签到奖励积分</view>
									<view class="text" style="font-size: 100rpx;">1788</view>
								</view>
								<view class="s"></view>
								<view style="margin-left: 80rpx;">
									<view class="title"
										style="border: 1.5px solid #FFFFFF;background: #FF7744;border-radius: 50px;padding: 20rpx 100rpx;">
										充值积分</view>
								</view>
								<image src="/static/image/user/credit/credit.png"
									style="position: absolute;bottom: 0; right: 0;width: 300rpx;" mode="widthFix">
								</image>
							</view>
							<view style="display: flex;justify-content: center;align-items: center;margin-top: 50rpx;">
								<view class="card-top">
									<view class="top-title">
										每日签到
									</view>
									<view class="card">
										<view style="color: #000000;font-size: 28rpx;">
											已连续签到：1天
										</view>
										<view
											style="margin-top: 28rpx;display: flex;justify-content: flex-start;align-items: center;"
											@click="show=true">
											<view
												style="background: #FFAA00;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #FFFFFF;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #FFAA00;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #FFFFFF;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #E0E2E4;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #000;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #E0E2E4;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #000;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #E0E2E4;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #000;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #E0E2E4;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #000;font-size: 32rpx;">
													2</view>
											</view>
											<view
												style="background: #E0E2E4;border-radius: 16rpx;width: 50rpx;padding: 20rpx;height: 70rpx;margin-left: 14rpx;">
												<view style="display: flex;justify-content:center;">
													<image src="/static/image/user/credit/s.png" style="width: 30rpx;"
														mode="widthFix"></image>
												</view>
												<view
													style="text-align: center;margin-top: 8rpx;color: #000;font-size: 32rpx;">
													10</view>
											</view>
										</view>
										<view style="color: #A2A2A2;font-size: 28rpx;margin-top: 28rpx;">
											连续签到满7天，最后一天可获得10积分
										</view>
									</view>
								</view>
								<view class="card-top">
									<view class="top-title">
										积分任务
									</view>
									<view class="card">
										<view class="flex-center" style="justify-content:space-between;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/user/credit/user.png"
														style="width: 70rpx;" mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>注册 </view>
														<view style="margin-left: 30rpx;" class="flex-center">
															<image src="/static/image/user/credit/s.png"
																style="width: 40rpx;" mode="widthFix"></image>
														</view>
														<view style="margin-left:15rpx;">+50 </view>
													</view>
													<view class="min-title">注册即送，每天3次免费生成次数</view>
												</view>
											</view>
											<view>
												<view class="button">已完成</view>
											</view>
										</view>
										<view class="flex-center"
											style="justify-content:space-between;margin-top: 50rpx;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/user/credit/msg.png" style="width: 70rpx;"
														mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>邀请好友 </view>
														<view style="margin-left: 30rpx;" class="flex-center">
															<image src="/static/image/user/credit/s.png"
																style="width: 40rpx;" mode="widthFix"></image>
														</view>
														<view style="margin-left:15rpx;">+100/人 </view>
													</view>
													<view class="min-title">邀请好友完成注册，获得100积分</view>
												</view>
											</view>
											<view>
												<view class="button" style="background: #0033FF;color: #FFFFFF;">去邀请
												</view>
											</view>
										</view>
									</view>
								</view>
								<view class="card-top">
									<view class="top-title">
										会员权益卡
									</view>
									<view class="card">
										<view class="flex-center" style="justify-content:space-between;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/home/vip.png" style="width: 70rpx;"
														mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>设辑体验卡 </view>
													</view>
													<view class="min-title">注册即送，10次免费生成次数</view>
												</view>
											</view>
											<view>
												<view class="button">已失效</view>
											</view>
										</view>
										<view class="flex-center"
											style="justify-content:space-between;margin-top: 50rpx;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/home/vip1.png" style="width: 70rpx;"
														mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>白银权益卡 </view>
													</view>
													<view class="min-title">无限生成次数，1GB云空间，300/月加速卡</view>
												</view>
											</view>
											<view>
												<view class="button" style="background: #0033FF;color: #FFFFFF;">去开通
												</view>
											</view>
										</view>
										<view class="flex-center"
											style="justify-content:space-between;margin-top: 50rpx;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/home/vip2.png" style="width: 70rpx;"
														mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>黄金权益卡 </view>
													</view>
													<view class="min-title">无限生成次数，10GB云空间，赠送2个IP</view>
												</view>
											</view>
											<view>
												<view class="button" style="background: #0033FF;color: #FFFFFF;">去开通
												</view>
											</view>
										</view>
										<view class="flex-center"
											style="justify-content:space-between;margin-top: 50rpx;">
											<view class="flex-center" style="justify-content:flex-start;">
												<view>
													<image src="/static/image/home/vip3.png" style="width: 70rpx;"
														mode="widthFix"></image>
												</view>
												<view style="margin-left: 20rpx;">
													<view class="title">
														<view>铂金权益卡 </view>
													</view>
													<view class="min-title">无限生成次数，无限云空间，赠送4个IP</view>
												</view>
											</view>
											<view>
												<view class="button cz" style="color: #FFFFFF;">去创作
												</view>
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</menu-wrapper>
		<!-- 页脚 -->
		<!-- <zw-footer></zw-footer> -->
		<fui-landscape :show="show" :closable="closable" @close="closePopup">
			<view class="fui-ani__box">
				<view class="flex-center" style="height:120rpx">
					<image src="/static/image/user/credit/credit.png" style="width: 300rpx;top: -50rpx;margin: 0 auto;"
						mode="widthFix">
					</image>
				</view>

				<view class="" style="display: grid;">

					<view class="fui-ani__title">签到成功</view>
					<view class="fui-desc">+2</view>
					<view class="fui-desc1">已签到2天</view>
					<view class="fui-button" @click="closePopup">
						<view>知道了</view>
					</view>
				</view>
			</view>
		</fui-landscape>
	</view>
</template>

<script>
	import menuWrapper from '@/components/user/common/menu-wrapper.vue';
	import centerConfig from '@/common/config/user/center.config.js';
	import {
		mapState
	} from 'vuex';

	export default {
		components: {
			menuWrapper,
		},
		data() {
			return {
				...centerConfig,
				accountInfo: {},
				counts: [],
				width: 0,
				tabIndex: 1,
				cardIndex: 1,
				show: false,
				closable: false
			}
		},
		computed: {
			...mapState(['loginUser']),
			currentTime() {
				const currentHour = new Date().getHours();
				const timeQuantums = ['凌晨', '上午', '下午', '晚上'];
				return timeQuantums[Math.floor(currentHour / 6)];
			}
		},
		onLoad() {
			this.getAccountInfo();
			this.findCounts();
			this.$store.commit('tab', 0);

		},
		onReady() {
			let that = this;
			const query = uni.createSelectorQuery();
			//获取宽度
			query.select('.item').fields({
				size: true
			}, (res) => {
				console.log('item', res)
				that.width = res.width;
				const height = res.height;
			}).exec();
		},
		methods: {
			closePopup() {
				this.show = false
			},
			click() {

			},
			goUrl(url) {
				uni.navigateTo({
					url: url,
					fail(err) {
						console.log(err)
					}
				})
			},
			clickCard(index) {
				this.cardIndex = index;
				// this.page = 0;
				// this.promos = [];
				// this.findPicture();
			},
			clickOption(index) {
				this.tabIndex = index;
				// this.page = 0;
				// this.promos = [];
				// this.findPicture();
			},
			getAccountInfo() {
				this.$util.request('/security/getAccountInfo', {}, (res) => {
					this.accountInfo = res.accountInfo;
				}, true);
			},
			findCounts() {
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				this.$util.request('/profile/counts', {}, (res) => {
					uni.hideLoading();
					this.counts = res;
				}, true);
			}
		}
	}
</script>

<style lang="scss">
	.fui-ani__box {
		width: 600rpx;
		height: 650rpx;
		border-radius: 40rpx;
		background-image: url('/static/image/user/credit/bg.png');
		background-size: cover;

		.fui-ani__title {
			font-family: 思源黑体;
			font-size: 48rpx;
			font-weight: 500;
			text-align: center;
			color: #000000;
		}

		.fui-desc {
			margin-top: 20rem;
			font-family: HarmonyOS Sans SC;
			font-size: 144rpx;
			font-weight: 900;
			text-align: center;
			color: #FFA000;
		}

		.fui-desc1 {
			margin-top: 20rpx;
			font-family: OPPOSans;
			font-size: 32rpx;
			font-weight: 500;
			text-align: center;
			color: #666666;
			margin-bottom: 80rpx;
		}

		.fui-button {
			padding: 15rpx 0rpx 15rpx 0rpx;
			width: 80%;
			background: #FF7744;
			border-radius: 100px;
			color: #FFFFFF;
			font-family: 思源黑体;
			font-size: 36rpx;
			font-weight: bold;
			text-align: center;
			// margin: 0 auto;
		}
	}

	.flex-center {
		display: flex;
		justify-items: center;
		align-items: center;
	}

	.card-top {
		width: 33%;

		.top-title {
			font-family: 思源黑体;
			font-size: 40rpx;
			font-weight: bold;
			color: #000000;
		}

		.card {
			padding: 50rpx;
			margin-top: 20rpx;
			border-radius: 28rpx;
			opacity: 1;
			width: 90%;
			height: 900upx;
			background: #FFFFFF;
			box-sizing: border-box;
			border: 4rpx solid #D8D8D8;

			.title {
				color: #000000;
				font-size: 36rpx;
				font-weight: 500;
				display: flex;
				justify-content: flex-start;
				align-items: center;
			}

			.button {
				color: #C4BFBF;
				font-size: 32rpx;
				border: 3rpx solid #C4BFBF;
				border-radius: 100px;
				padding: 5rpx 20rpx;
			}

			.cz {
				background: linear-gradient(90deg, #0033FF 0%, rgba(0, 51, 255, 0.9786) 0%, rgba(110, 24, 255, 0.9899) 43%, #D000FF 83%);
			}

			.min-title {
				color: #999999;
				font-size: 28rpx;
				font-weight: 500;
			}
		}
	}

	.s {
		width: 160rpx;
		height: 0px;
		margin-left: 80rpx;
		transform: rotate(90deg);
		opacity: 1;
		border: 2rpx solid #C48B19;
	}

	.title {
		font-family: HarmonyOS Sans SC;
		font-size: 14px;
		font-weight: normal;
		text-align: center;
		color: #FFFFFF;
	}

	.text {
		font-family: HarmonyOS Sans SC;
		font-size: 64px;
		font-weight: 500;
		text-align: center;
		color: #FFFFFF;
	}

	.left {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.card-header {

		// display: flex;
		// justify-content: space-between;
		// align-items: center;
	}
</style>